<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>专属活动</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="/zhenze/Public/home/css/reset.css"/>
		<link rel="stylesheet" href="/zhenze/Public/home/css/zuixinhuodong.css" />
		<link rel="stylesheet" href="/zhenze/Public/home/css/font-awesome.min.css" />
		<style>
		.btn00{line-height: 1.4rem;width: 16.75rem;margin: 1rem auto;border: none;background:#FF3C00;color: #FFFFFF;font-size:0.75rem;display: block;}
		</style>
	</head>
	<body>
		<div class="top">
			<a href="javascript:history.go(-1);"><i class="fa fa-angle-left"></i></a>
			<p>专属活动</p>
		</div>
		<div class="containter">
			<h1>专属活动</h1>
			<ul id="jubu">
				<?php if(is_array($listinfo)): $i = 0; $__LIST__ = $listinfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><li onclick="tiao('<?php echo $data['id']?>')">
					<img src="<?php echo ($data["event_image"]); ?>" />
					<p><?php echo ($data["event_title"]); ?></p>
					<p><?php echo (date("Y.m.d",$data["event_starttime"])); ?>--<?php echo (date("Y.m.d",$data["event_endtime"])); ?></p>
					<p><?php echo ($data["event_description"]); ?></p>
					<?php if($data["event_endtime"] > SYS_TIME): ?><button class="btnn co01">活动中</button>
					<?php else: ?> 
						<button class="btnn co02">已结束</button><?php endif; ?>
					<div class="clear"></div>	
				</li><?php endforeach; endif; else: echo "" ;endif; ?>
				
			</ul>
			<div class="list"></div>
		</div>
		<button onclick="getmore()" id="morebtn" data='1' class="btn00">更多</button>
		
		<script type="text/javascript" src="/zhenze/Public/home/js/jquery-3.1.1.min.js" ></script>
		<script src="/zhenze/Public/home/js/screenSize.js" type="text/javascript" charset="utf-8"></script>
	</body>
	<script>
		function getmore(){			
			var page=parseInt($('#morebtn').attr("data"))+1;
		
				$.getJSON("<?php echo U('index/eventinfo');?>&p="+page,function(result){
				$('#morebtn').attr("data",page);//重置当前页数
				var data=result.listinfo;
				if(data.length>0){
					var html="";
					for(var i=0;i<data.length;i++){
						html+='<ul id="jubu">';
						html+='		<li onclick="tiao('+data[i].id+')">';
						html+='			<img src="'+data[i].event_image+'" />';
						html+='			<p>'+data[i].event_title+'</p>';
						html+='			<p>'+data[i].event_starttime+'--'+data[i].event_endtime+'</p>';
						html+='			<p>'+data[i].event_description+'</p>';
						if(data[i].type==1){
						html+='			<button class="btnn co01">活动中</button>';

						}else{
						html+='			<button class="btnn co02">已结束</button>';
						}
						html+='			<div class="clear"></div>';
						html+='		</li>';
						html+='</ul>';
					}
					$(".list").append(html);
				}else{
					$("#morebtn").html('亲，没有数据了！');
				}
			});
		}
		//跳转页面
		function tiao(m){
             location.href='<?php echo U('index/dailinews');?>&event_id='+m;		
		}
		</script>
</html>